@include('usercenter.header')
    <div class="template-page-wrapper">
      <div class="navbar-collapse collapse templatemo-sidebar">
        <ul class="templatemo-sidebar-menu">
          <li>
            <form class="navbar-form">
              <input type="text" class="form-control" id="templatemo_search_box" placeholder="搜索...">
              <span class="btn btn-default"><i class="fa fa-search"></i></span>
            </form>
          </li>
          <li><a href="{{url('user/usercente')}}"><i class="fa fa-home"></i>用户中心</a></li>
          <li class="sub active">
            <a href="javascript:;">
              <i class="fa fa-database"></i> 账户设置 <div class="pull-right"><span class="caret"></span></div>
            </a>
            <ul class="templatemo-submenu">
              <li><a href="{{url('user/editnick')}}">修改昵称</a></li>
              <li><a href="{{url('user/editpwd')}}">修改密码</a></li>
              <li><a href="{{url('user/editphone')}}">修改绑定手机</a></li>
              <li><a href="{{url('user/editemail')}}">修改绑定邮箱</a></li>
              <li><a href="{{url('user/editmibao')}}">修改密保</a></li>
            </ul>
          </li>
          <li class="sub">
            <a href="{{url('user/gamedetail')}}">
              <i class="fa fa-database"></i> 比赛详情
            </a>
          </li>
          <li class="sub">
            <a href="javascript:;">
              <i class="fa fa-database"></i> 财富中心 <div class="pull-right"><span class="caret"></span></div>
            </a>
            <ul class="templatemo-submenu">
              <li><a href="{{url('user/mymoney')}}">我的煤球</a></li>
              <li><a href="{{url('user/monrec')}}">充值记录</a></li>
              <li><a href="{{url('user/chrmoney')}}">充值中心</a></li>
            </ul>
          </li>
          <li class="sub">
            <a href="javascript:;">
              <i class="fa fa-database"></i> 收信箱 <div class="pull-right"><span class="caret"></span></div>
            </a>
            <ul class="templatemo-submenu">
              <li><a href="{{url('user/allmessage')}}">所有信件</a></li>
              <li><a href="{{url('user/notread')}}">未读信件</a></li>
              <li><a href="{{url('user/read')}}">已读信件</a></li>
            </ul>
          </li>
          <li><a href="javascript:;" data-toggle="modal" data-target="#confirmModal"><i class="fa fa-sign-out"></i>返回首页</a></li>
        </ul>
      </div><!--/.navbar-collapse -->

      <div class="templatemo-content-wrapper">
        <div class="templatemo-content">
          <ol class="breadcrumb row">
            <li><a href="{{url('user/usercente')}}">用户中心</a></li>
            <li><a href="#">账户设置</a></li>
            <li class="active">修改绑定手机</li>
          </ol>

        

<!-- startmyself -->

             <div class="row">
               <div class="panel panel-info">
                 <div class="panel-heading">修改绑定手机</div>
               </div>
             </div>

             <form action="{{url('user/oldphone')}}" class="form-inline" method="post">
             {!!csrf_field()!!}
              <table class="table">
                <tr>
                  <td>
                    <div class="input-group input-group-lg col-md-12">
                      <h4>当前状态:<span>已绑定{{$phone}}</span></h4>
                      <p>
                      绑定成功后您可通过手机找回密码以及使用手机号登录，一个手机号只能关联一个通行证帐号
                      </p>
                    </div>
                  </td>
                </tr>
                <tr>
                   <td>
                      <div class="input-group input-group-lg col-md-4">
                        <span class="bg-info input-group-addon" id="basic-addon1">旧手机号</span>
                        <input type="text" class="form-control" aria-describedby="basic-addon1" name="old_phone">
                      </div>
                      <input type="button" class="btn-group btn-default btn-lg" id="old_yzm" value="免费获取验证码">
                    </td>
                </tr>
                <tr>
                  <td>
                    <span>无法收到验证短信?不要着急,您还可以通过</span>
                    <a href="" title="">邮箱验证</a>
                    <a href="" title="">密保验证</a>
                  </td>
                </tr>
                 <tr>
                   <td>
                    <div class="input-group input-group-lg col-md-4">
                      <span class="bg-info input-group-addon" id="basic-addon1">验证码&nbsp;&nbsp;&nbsp;&nbsp;</span>
                      <input type="text" class="form-control" aria-describedby="basic-addon1" name="rev_oyzm">  
                    </div>
                    </td>
                </tr>
          
                <tr>
                  <td>
                   <input type="submit" class="btn-info btn-group btn-primary btn-lg" value="下一步">
                  </td>
               </tr>
              </table>  
            <input type="hidden" id="cang" value="{{$oldphone}}">
             </form>
         
<!-- /startmyself -->

        </div>
      </div>
      <!-- Modal -->
     
    @include('usercenter.footer')
    </div>

    <script src="/user/usercenter/js/jquery.min.js"></script>
    <script src="/user/usercenter/js/bootstrap.min.js"></script>
    <script src="/user/usercenter/js/Chart.min.js"></script>
    <script src="/user/usercenter/js/templatemo_script.js"></script>
    <script type="text/javascript">
        $('#old_yzm').click(function(){

          //检查是否输入手机号
          if ($('input[name=old_phone]').val() == '') {
            return false;
          } 
          //验证是否输入正确
          if ($('#cang').val() != $('input[name=old_phone]').val()){
            alert('手机号输入错误');
            return false;
          }
          //旧手机号发验证码
          var data = {
            'input' : $('input[name=old_phone]').val(),
          }
          $.ajax({
            url :'/send',
            type : 'POST',
            data : data,
            async : true,
            success : function(ev){
              if (ev) {
                //
              }else {
                alert('一分钟内只能发送一次');
              }
            }
    
          });

        });

    </script>
</body>
</html>
